{
 "metadata": {
  "name": "",
  "signature": "sha256:ba511923de455bcf788f5da128d343dab0909a6325fdf5cfcb163b29cb1ee6d3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "This file contains example code to demonstrate various Pandas features."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import print_function, division\n",
      "\n",
      "%matplotlib inline"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "For the first example, I'll work with data from the BRFSS"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import brfss\n",
      "df = brfss.ReadBrfss(nrows=5000)\n",
      "df['height'] = df.htm3"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Of the first 5000 respondents, 42 have invalid heights.  Note that most obvious ways of checking for null don't work."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sum(df.height.isnull())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 4,
       "text": [
        "42"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Use dropna to select valid heights."
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "valid_heights = df.height.dropna()\n",
      "len(valid_heights)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "4958"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "EstimatedPdf is an interface to gaussian_kde"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkstats2\n",
      "pdf = thinkstats2.EstimatedPdf(valid_heights)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The kde object provides resample:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fillable = pdf.kde.resample(len(df)).flatten()\n",
      "fillable.shape"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "(5000,)"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Or you can use thinkstats objects instead.  First convert from EstimatedPdf to Pmf"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkplot\n",
      "pmf = pdf.MakePmf()\n",
      "thinkplot.Pdf(pmf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEACAYAAABcXmojAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VNX9//HXZIcAYV8TCFsgbAqyCuKAG6CC21fqUtdf\ntbW4td+q3aGbS6u1fv2WYuuCfquiYhWsiohMBdQAguwhhBhCWMIeIJB15vfHvZm5GZLMBJLcWd7P\nx2Me3HPvuTOfXJL7mXvOueeCiIiIiIiIiIiIiIiIiIiIiIiIiIhIk5sCZAM7gEfrqPOcuX0DMNxv\nWyywHlhsWdceWArkAJ8AbRsxXhERaSKxQC6QDsQD3wCZfnWmAR+ay2OAr/y2/wj4J7DIsu4p4BFz\n+VHgiUaLWEREmsw44GNL+THzZfU3YKalnA10MZdTgU+BSdS8UrDW6WqWRUTEZjEBtvcAdlvKhea6\nYOv8GfgJ4PbbpwtQZC4X4UsQIiJio0BJwRPk+zhqKV8FHMDoT/Df7v8ZwX6OiIg0obgA2/c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yxkYTScQncdiHb7JJC/BSJIQ+cfCAbwK/NlvfV03wkby8ajrWIT9+fMNYC/GZc5ujDawHcAujOF2\n64G/Wur/DKODJBvf6ItIUX0syjCOxZ1+2/OoOSQ12o5FPMa3w00YV0xOS/1oOBbVfyN3YvSnZGH8\nkX+J0Z5cLZKPxQSMK8Rv8J0fplD/jbCRejxqOxZTid7zp4iIiIiIiIiIiIiIiIiIiIiIiIiIiIiI\niIiIhLr/D3Za3Sgax5b/AAAAAElFTkSuQmCC\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f852aa6e5d0>"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "You can use the Pmf to generate a random sample, but it is faster to convert to Cdf:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "cdf = pmf.MakeCdf()\n",
      "fillable = cdf.Sample(len(df))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 9
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Then we can use fillna to replace NaNs"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import pandas\n",
      "series = pandas.Series(fillable)\n",
      "df.height.fillna(series, inplace=True)\n",
      "sum(df.height.isnull())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 10,
       "text": [
        "0"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "cdf = thinkstats2.Cdf(df.height)\n",
      "thinkplot.Cdf(cdf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 11,
       "text": [
        "{'xscale': 'linear', 'yscale': 'linear'}"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAAN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LW9QHonU287vgp9Mfs7cjfp+sMx0i/sk6Tx11mR++LHSO/cnmMu\nHzaTfi/+gu7TJKP2R7e+2EJ181OSJEmSJEmSJEmSJEmSJEmSJElSNP8P/LvT4r3iXUMAAAAASUVO\nRK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f852aa33410>"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 11
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import brfss\n",
      "resp = brfss.ReadBrfss(nrows=5000).dropna(subset=['sex', 'htm3'])\n",
      "grouped = resp.groupby('sex')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for i, group in grouped:\n",
      "    print(i, group.shape)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1 (1611, 6)\n",
        "2 (3347, 6)\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "grouped.get_group(1).mean()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 26,
       "text": [
        "age         54.868077\n",
        "sex          1.000000\n",
        "wtyrago     92.561772\n",
        "finalwt    782.980373\n",
        "wtkg2       91.694793\n",
        "htm3       179.120422\n",
        "dtype: float64"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "grouped.mean()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>age</th>\n",
        "      <th>wtyrago</th>\n",
        "      <th>finalwt</th>\n",
        "      <th>wtkg2</th>\n",
        "      <th>htm3</th>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>sex</th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 54.868077</td>\n",
        "      <td> 92.561772</td>\n",
        "      <td> 782.980373</td>\n",
        "      <td> 91.694793</td>\n",
        "      <td> 179.120422</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 54.891468</td>\n",
        "      <td> 76.803614</td>\n",
        "      <td> 418.628225</td>\n",
        "      <td> 76.282271</td>\n",
        "      <td> 163.973110</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 23,
       "text": [
        "           age    wtyrago     finalwt      wtkg2        htm3\n",
        "sex                                                         \n",
        "1    54.868077  92.561772  782.980373  91.694793  179.120422\n",
        "2    54.891468  76.803614  418.628225  76.282271  163.973110"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "grouped['htm3'].mean()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 21,
       "text": [
        "sex\n",
        "1      179.120422\n",
        "2      163.973110\n",
        "Name: htm3, dtype: float64"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "grouped.htm3.std()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 27,
       "text": [
        "sex\n",
        "1      7.643153\n",
        "2      7.013427\n",
        "Name: htm3, dtype: float64"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy\n",
      "grouped.aggregate(numpy.mean)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>age</th>\n",
        "      <th>wtyrago</th>\n",
        "      <th>finalwt</th>\n",
        "      <th>wtkg2</th>\n",
        "      <th>htm3</th>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>sex</th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 54.868077</td>\n",
        "      <td> 92.561772</td>\n",
        "      <td> 782.980373</td>\n",
        "      <td> 91.694793</td>\n",
        "      <td> 179.120422</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 54.891468</td>\n",
        "      <td> 76.803614</td>\n",
        "      <td> 418.628225</td>\n",
        "      <td> 76.282271</td>\n",
        "      <td> 163.973110</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 18,
       "text": [
        "           age    wtyrago     finalwt      wtkg2        htm3\n",
        "sex                                                         \n",
        "1    54.868077  92.561772  782.980373  91.694793  179.120422\n",
        "2    54.891468  76.803614  418.628225  76.282271  163.973110"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "grouped.aggregate(numpy.std)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>age</th>\n",
        "      <th>wtyrago</th>\n",
        "      <th>finalwt</th>\n",
        "      <th>wtkg2</th>\n",
        "      <th>htm3</th>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>sex</th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "      <th></th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 15.979595</td>\n",
        "      <td> 20.082096</td>\n",
        "      <td> 891.896249</td>\n",
        "      <td> 19.124774</td>\n",
        "      <td> 7.643153</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 16.318462</td>\n",
        "      <td> 20.818984</td>\n",
        "      <td> 480.059627</td>\n",
        "      <td> 19.615797</td>\n",
        "      <td> 7.013427</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 19,
       "text": [
        "           age    wtyrago     finalwt      wtkg2      htm3\n",
        "sex                                                       \n",
        "1    15.979595  20.082096  891.896249  19.124774  7.643153\n",
        "2    16.318462  20.818984  480.059627  19.615797  7.013427"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "d = {}\n",
      "for name, group in grouped:\n",
      "    d[name] = group.htm3.values"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 13,
       "text": [
        "{1: array([ 170.,  185.,  183., ...,  178.,  175.,  170.]),\n",
        " 2: array([ 157.,  163.,  165., ...,  168.,  157.,  173.])}"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import brfss\n",
      "resp = brfss.ReadBrfss().dropna(subset=['sex', 'wtkg2'])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "groups = resp.groupby('sex')\n",
      "d = {}\n",
      "for name, group in groups:\n",
      "    d[name] = group.wtkg2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "{1: 3      73.64\n",
        " 4      88.64\n",
        " 5     109.09\n",
        " 8      90.00\n",
        " 9      77.27\n",
        " 10     63.64\n",
        " 13    127.27\n",
        " 20     76.36\n",
        " 23     78.18\n",
        " 26     77.27\n",
        " 35     81.82\n",
        " 39     90.00\n",
        " 42     90.91\n",
        " 45     93.18\n",
        " 50     81.82\n",
        " ...\n",
        " 414468     63.64\n",
        " 414470     81.82\n",
        " 414474     87.73\n",
        " 414475    113.64\n",
        " 414477    100.91\n",
        " 414480     89.09\n",
        " 414481     76.36\n",
        " 414488    102.27\n",
        " 414490     71.82\n",
        " 414498     75.00\n",
        " 414501     86.36\n",
        " 414503     78.18\n",
        " 414504     88.64\n",
        " 414506     90.91\n",
        " 414508     75.00\n",
        " Name: wtkg2, Length: 153900, dtype: float64, 2: 0      70.91\n",
        " 1      72.73\n",
        " 6      50.00\n",
        " 7     122.73\n",
        " 11     78.18\n",
        " 12     62.73\n",
        " 14     95.45\n",
        " 15     88.64\n",
        " 16     90.91\n",
        " 17     50.00\n",
        " 18    100.00\n",
        " 19     72.73\n",
        " 21     63.64\n",
        " 22     55.45\n",
        " 24     90.91\n",
        " ...\n",
        " 414483     68.18\n",
        " 414484     87.27\n",
        " 414485     77.27\n",
        " 414486     61.36\n",
        " 414489     86.36\n",
        " 414492     70.45\n",
        " 414493     56.82\n",
        " 414494     68.18\n",
        " 414495     72.73\n",
        " 414496     56.82\n",
        " 414497     65.91\n",
        " 414499    129.55\n",
        " 414500     75.00\n",
        " 414505     72.73\n",
        " 414507     89.09\n",
        " Name: wtkg2, Length: 244584, dtype: float64}"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy\n",
      "\n",
      "for sex, weights in d.items():\n",
      "    print(sex, numpy.log(weights).mean(), numpy.log(weights).std())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1, 4.4693001977146656, 0.19557721757853172)\n",
        "(2, 4.2596856357921178, 0.22599757494674719)\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import scipy.stats"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "shape, loc, scale = scipy.stats.lognorm.fit(d[1], floc=0)\n",
      "shape, loc, scale"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 28,
       "text": [
        "(0.19557677265342968, 0, 87.295636995626353)"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "shape, loc, scale = scipy.stats.lognorm.fit(d[2], floc=0)\n",
      "shape, loc, scale"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 27,
       "text": [
        "(0.22599714638037718, 0, 70.787767991419116)"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkstats2\n",
      "cdf = thinkstats2.Cdf(d[2])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import thinkplot\n",
      "%matplotlib inline\n",
      "\n",
      "thinkplot.Cdf(cdf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 14,
       "text": [
        "{'xscale': 'linear', 'yscale': 'linear'}"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEGBJREFUeJzt3W+MFPd9x/H3BnCvrhOlFpKTAhURsVIcNeRPi5HybyNb\nNfhBsZAKxm1xnLbmQUmrVmoIedDsk/5x1KhRROXghETQysY0oZyjnO2mbVaprNgOqoEYwxVIkQC7\nJP0XJW2jgtg++M3d7Q27t3O7s7Mzv32/pBM7u8PwZRY+97vv/H6zIEmSJEmSJEmSJEmSJEmSNLa+\nCFwBvrPAPp8FzgIngHcVUZQkaXDvJ4R2t4C/F5hKHt8JPF9EUZKkfKyme8B/DtjWtn0GuG3YBUmS\nFva6HI6xArjYtn0JWJnDcSVJA8gj4AFqqe1WTseVJPVpaQ7HuAysattemTw3z5o1a1rnz5/P4Y+T\npLFyHnhrP78xj4B/CtgFHAI2AP9FmHUzz/nz52m1qjuwbzQaNBqNUZfRtyLqn5ya5smjp/jxj6/l\netzTJ/6atet+JddjFsn6R2sx9R85uHXI1SxerVZb0+/vzRLwTwAfBJYTeu2fBJYlr+0jzKC5FzgH\n/DfwUL/FqDryDPOJ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T8ttKKFvR94F/MDslu9dxDeh2WE9+Uco79lRaf6Pwn8fod9y1b/m4B3Jo9vIbQz11Kd\n89+t/qqcf4Cbk1+XEq4Bvo/qnH/oXH8u53/Yf7EsC6XKKj3DqH1B1wHgvmLLWdA/Av+Zeq5bvZuB\nJwjvxwXC+7N++CUuqFP90HmWV9nq/1fCfziAHwGnCWtDqnL+u9UP1Tj/EG6RAmEiyBLCv6WqnH/o\nXD/kcP6HHfCdFkGt6LJvmbSAvwOOAb+VPHcbc1M/r1D+1brd6v0Zwvswo8zvyUcJF+73M/cjdpnr\nX034SeQFqnn+VxPqn5kJV5Xz/zrCN6krzLWbqnT+O9UPOZz/YQd8IQuehuC9hH/om4DfJrQQ2rWo\n1t+tV71l/Ls8CryF0D54Dfj0AvuWof5bgK8Avwv8MPVaFc7/LcCXCfX/iGqd/+uEOlcCHwA+lHq9\n7Oc/XX+dnM7/sAP+MuEizoxVzP/uU1avJb9+H/gbwo9AVwj9SoA3A98bQV2L0a3e9HuyMnmubL7H\n3H/MLzD3Y2gZ619GCPe/BI4mz1Xp/M/U/1fM1V+l8z/jB8DXgPdQrfM/Y6b+X6Ai5z/LQqmyuRl4\nffL4p4DnCFeqP8XcLKCPU66LrBDOcfoia6d6Zy7S3EQYIZyn94rmIqxmfv1vbnv8e8DjyeOy1V8D\nDgJ/nnq+Kue/W/1VOf/LmWtf/CTwTeAuqnP+u9X/prZ9ynz+Oy6UKrO3EE7gccK0sZmabyX05cs4\nTfIJ4FXg/wjXPB5i4Xo/QXg/zgD3FFppZ+n6P0IInZOEHuRR5l/zKFP97yP8iH2cuSltG6nO+e9U\n/yaqc/5/HvgnQv0ngT9Inq/K+e9Wf1XOvyRJkiRJkiRJkiRJkiRJkiRJkiQt7P8BeuoM4V/Dg3gA\nAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f6a0b4cce10>"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "rv = scipy.stats.lognorm(0.23, 0, 70.8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 25
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import matplotlib.pyplot as pyplot\n",
      "xs = numpy.linspace(20, 200, 100)\n",
      "ys = rv.cdf(xs)\n",
      "thinkplot.Cdf(cdf)\n",
      "pyplot.plot(xs, ys)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 26,
       "text": [
        "[<matplotlib.lines.Line2D at 0x7f6a0b53e150>]"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGeZJREFUeJzt3X1wVPWhxvHvZjckuwkBIi8iiQQBBZtaFKv05dbtSAW1\nLS3aa9XWW23V6Vytt69Up73m3hnba2fa23Gwiq3at0Haq9GxYqXWmtZatGJFjWURCIEkhBWEvJHd\nJLs594+zm4SQsJvN2T3n7D6fGcZ9OSyPJ/Dkl9/5nXNARERERERERERERERERERERERERKRgPQSE\ngTdPss09wC7gdeDcXIQSEZHJ+xfM0h6v4C8Dnk48vhB4KRehRETEGjWMX/D3A1eNeB4C5mQ7kIiI\nnFyRBZ8xD2gZ8bwVqLLgc0VEZBKsKHgAz6jnhkWfKyIiGfJZ8BltQPWI51WJ146zcOFCY8+ePRb8\ncSIiBWUPsCiT32hFwT8J3AJsAlYAHZirbo6zZ88eDMO9A/u6ujrq6ursjpGxyeY3DAiF4Lnn4MUX\n4aWX4PBhqK2Fs8+GxYvhUEkHr0XfwTMtypRpAxR5rcn+9qMbOPPKm635MBsov70mkn/zZ5dnOc3E\neTyehZn+3nQK/hHgImAm5lz7nUBx4r0NmCtoLgN2A8eA6zMNI85iGLB1K/zmN/DEE+ZrK1fC6tXw\nwesO09DdSnQw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DB/vdiTt3UAMWMPYfvRHsx/4KM9APgW4nH64D/yWmik/sX\nzDOIRxbkeHnPxvw6FGN+XXZj/yUrxsp/J/C1MbZ1Wv5TgeR62nLM6cyluGf/j5ffLfsfIJD4rw/z\nGOCHcc/+h7HzW7L/s/0/ls6JUk41eoXRyBO6fgF8KrdxTuoF4Oio18bLuwZ4BPPr0Yz59bkg+xFP\naqz8MPYqL6flP4j5Dw6gB9iBeW6IW/b/ePnBHfsfoDfx3ymYg8qjuGf/w9j5wYL9n+2CH+skqHnj\nbOskBvBHYBuQvOXHHIaXfoZx/tm64+U9DfPrkOTkr8mtmAfuH2T4R2wn56/B/EnkZdy5/2sw8ydX\nwrll/xdhfpMKMzzd5Kb9P1Z+sGD/Z7vgs3bCU5Z9CPMv+qXAv2NOIYxk4K7/t1R5nfj/ch+wAHP6\noB344Um2dUL+cuAx4Dage9R7btj/5cCjmPl7cNf+H8TMWQV8BPjoqPedvv9H5w9i0f7PdsG3YR7E\nSarm+O8+TpW8EPwh4HHMH4HCmPOVAHOBd2zINRHj5R39NalKvOY07zD8D/NnDP8Y6sT8xZjl/ivg\nicRrbtr/yfy/Zji/m/Z/UiewGViOu/Z/UjL/+bhk/6dzopTTBICpicdlwIuYR6p/wPAqoG/jrIOs\nYO7j0QdZx8qbPEgzBXOEsIfUZzTnQg3H5x95rYivAhsTj52W3wP8EvjfUa+7Zf+Pl98t+38mw9MX\nfuAvwMW4Z/+Pl//UEds4ef+PeaKUky3A3IHbMZeNJTNXYs7LO3GZ5CPAAaAf85jH9Zw87x2YX48Q\nsCqnScc2Ov8NmKXzBuYc5BMcf8zDSfk/jPkj9naGl7Stxj37f6z8l+Ke/f9e4B+Y+d8Avpl43S37\nf7z8btn/IiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIn9/8aEr0BUuFSGgAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x7f6a0adc0210>"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}